/**
 *  处理图片加载错误
 */
document.onreadystatechange = function () {
    if (document.readyState === "interactive") {
        var images = document.getElementsByTagName('img');
        for (var i=0; i<images.length; i++){
            images[i].onerror = function () {
                if(this.dataset.placeholder){ // 有placeholder就替换
                    this.src = this.dataset.placeholder;
                }
            }
        }
    }
}